package test.office

import aquerius.{Database, Schema, Basic}
import Basic._

/**
 * @author: Yardena
 * @date: Jul 20, 2009 11:31:36 AM
 */

trait OfficeSchema extends Schema { db: Database =>

  trait EmployeeTable extends Table { self: TableType =>
    type RecordType = (String,Int,Int,Boolean)
    val name    = str (_ _1)
    val id      = int (_ _2)
    val dept_id = int (_ _3)
    val manager = bool(_ _4)
    val columns = (name, id, dept_id, manager)
  }
  def employee : EmployeeTable

  trait  DepartmentTable extends Table { self: TableType =>
    type RecordType = (String,Int)
    val name    = str(_ _1)
    val id      = int(_ _2)
  }
  def department : DepartmentTable

}